#pragma once

#include "Character/Creature.h"
#include "BuffEffectCfg.h"
#include "BuffEffectInfo.h"

class IBuffLogic
{
public:
	enum { ID = effectTypeNone, };
	IBuffLogic()
	{

	}

	virtual ~IBuffLogic()
	{

	}
public:
	virtual bool InitFromData(const BuffEffectCfgInfo& buffInfo, BuffBagEffectInfo* pBuffBag, BuffEffectInfo* pBuff, CharIDType senderCid, Creature* pRecv, int32_t param) { return true; }
public:
	virtual void OnEvent_Active(BuffEffectInfo* pBuff, Creature* pRecv) const;
	virtual void OnEvent_FadeOut(BuffEffectInfo* pBuff, Creature* pRecv) const; //BUFF消失
public:
	//抵挡敌方造成的伤害，比如:生命盾, 抵挡伤害
	virtual void OnEvent_ReduceDamage(BuffEffectInfo* pBuff, Creature* pRecv, Creature* pAttack, uint32_t skillId, int32_t &damage) const;
	//对敌方增加额外伤害
	virtual void OnEvent_AddExtraDamage(BuffEffectInfo* pBuff, Creature* pRecv, Creature* pBeAttacked, uint32_t skillId, int32_t &damage) const;
	virtual void OnEvent_CountSkill(BuffEffectInfo* pBuff, Creature* pRecv, uint32_t skillId) const;
};

